package configuracion;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import servicio.SActividad;
import servicio.SCliente;
import servicio.SComponente;
import servicio.SEnlaceInteres;
import servicio.SGarantia;
import servicio.SManoObra;
import servicio.SMaquina;
import servicio.SMarca;
import servicio.SMateriales;
import servicio.SNoticia;
import servicio.SPorcentaje;
import servicio.SSubComponente;
import servicio.STipoIndustria;
import servicio.STipoSubComponente;
import servicio.ServicioEstudiante;





public class GeneradorBeans implements ApplicationContextAware {
	
	private static ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
	"/META-INF/ConfiguracionAplicacion.xml");

public void setApplicationContext(ApplicationContext applicationContext)
	throws BeansException {
 GeneradorBeans.applicationContext = applicationContext;
 }

 public static ApplicationContext getApplicationContext() {
 return applicationContext;
 }
    
 public static SMarca getServicioMarca() {
		return applicationContext.getBean(SMarca.class);
	}

 public static SComponente getServicioComponente() {
		return applicationContext.getBean(SComponente.class);
	}
 public static ServicioEstudiante getServicioEstudiante(){
	 return applicationContext.getBean(ServicioEstudiante.class);
 }
 public static SGarantia getServicioGarantia(){
	 return applicationContext.getBean(SGarantia.class);
 }

 public static STipoIndustria getServicioTipoIndustria(){
	 return applicationContext.getBean(STipoIndustria.class);
 }
 
 public static STipoSubComponente getServicioTipoSubComponente(){
	 return applicationContext.getBean(STipoSubComponente.class);
 }
 
 public static SPorcentaje getServicioPorcentaje(){
	 return applicationContext.getBean(SPorcentaje.class);
 }
 
 public static SManoObra getServicioManoObra(){
	 return applicationContext.getBean(SManoObra.class);
 }
 
 public static SMateriales getServicioMateriales(){
	 return applicationContext.getBean(SMateriales.class);
 }
 
 public static SActividad getServicioActividad(){
	 return applicationContext.getBean(SActividad.class);
 }
 public static SEnlaceInteres getServicioEnlaceInteres(){
	 return applicationContext.getBean(SEnlaceInteres.class);
 }
 
 public static SNoticia getServicioNoticia(){
	 return applicationContext.getBean(SNoticia.class);
 }
 public static SCliente getServicioCliente(){
	 return applicationContext.getBean(SCliente.class);
 }
 
 public static SSubComponente getServicioSubComponente(){
	 return applicationContext.getBean(SSubComponente.class);
 }
 
 public static SMaquina getServicioMaquina(){
	 return applicationContext.getBean(SMaquina.class);
 }
 
}
